﻿using System.Collections.Generic;
using System.Web.Mvc;

namespace Inovout.Web.Mvc
{
    public class UniqueAttribute1 : RemoteAttribute, IClientValidatable
    {
        public UniqueAttribute1()
            : base("IsUnique", "Validation")
        {
            HttpMethod = "POST";
        }
        public override bool IsValid(object value)
        {
            throw new System.NotImplementedException();
        }

        IEnumerable<ModelClientValidationRule> IClientValidatable.GetClientValidationRules(ModelMetadata metadata,
            ControllerContext context)
        {
            //添加验证相关信息，如：类型，ID等。
            //AdditionalFields = string.IsNullOrEmpty(AdditionalFields)?"Id":AdditionalFields+",Id";

            return base.GetClientValidationRules(metadata, context);
        }
    }
}
